Skip to content

Rust backend#623

Draft
tony wants to merge 12 commits into
masterfrom
rust
Draft

Rust backend#623
tony wants to merge 12 commits into
masterfrom
rust

Conversation

@tony

@tony tony commented Jan 24, 2026

Copy link
Copy Markdown
Member

Summary

  • Add optional Rust backend integration for tmux command execution and server lifecycle checks.
  • Add lightweight JSONL tracing with pytest integration and per-test context.
  • Add optional OpenTelemetry spans/exporter support (OTLP HTTP).
  • Update pytest plugin to support Rust control-mode subscriptions.
  • Extend CI matrix to exercise the Rust control backend when available.
  • Add otel extra and lockfile updates for OTel dependencies.

Notes

  • The vibe-tmux (Rust backend) dependency is not public yet; CI skips Rust backend tests when it’s unavailable.

Closes tmux-python/tmuxp#983

@tony tony changed the title Add optional Rust backend, tracing/OTel instrumentation, and CI coverage Rust backend Jan 24, 2026
@tony tony self-assigned this Jan 24, 2026
@tony
tony force-pushed the rust branch 2 times, most recently from ebc6a35 to 73262c1 Compare January 31, 2026 22:50
tony added 12 commits July 18, 2026 05:43
why: allow libtmux tests to drive a rust-backed tmux_cmd without altering object APIs.
what:
- route tmux_cmd through vibe_tmux when LIBTMUX_BACKEND=rust
- add LIBTMUX_RUST_CONNECTION_KIND for explicit bin/protocol selection
- align raise_if_dead with rust backend exit semantics
why: Config-backed servers should start and load config without breaking liveness checks.
what:
- run first command with -f via tmux bin when server is down
- align rust-backend server helpers to new signature
- refine rust helper error handling and typing
why: We need per-test timing breakdowns to locate slow paths.
what:
- emit JSONL spans for libtmux rust backend calls
- surface trace summary in pytest terminal output
- capture server is_alive/require_server timing
why: Need per-command context when tracing slow rust backend calls.
what:
- include socket/config/connection_kind on rust_server_cmd span
why: Control-mode refresh hints should not trigger background view capture during tests.
what:
- Subscribe with capture_view=false for rust control-mode test server
why: Keep libtmux spans connected to vibe-tmux and propagate traceparent into Rust backend calls.
what:
- Add traceparent scope helper and current-span extraction fallback
- Wrap rust backend calls with traceparent context in common/server paths
why: The rebase onto current master surfaced a missing contextlib
import from conflict resolution, and the branch predated master's
current lint/type gate (docstrings, typed otel shims, import
ordering, line lengths).

what:
- Import contextlib in server.py for the otel fallback shim
- Type the start_span/traceparent_scope fallback shims to match
  libtmux.otel's signatures and add docstrings
- Annotate and reformat libtmux/otel.py; use contextlib.suppress
- Add mypy overrides for optional opentelemetry/vibe_tmux imports
- Keep the pytest plugin's dynamic _rust_refresh via setattr with a
  B010 suppression so mypy doesn't require a typed attribute
- Apply ruff autofixes (import sort, nested with, formatting)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ feature request ] Rewrite in Rust

1 participant